-- GENERATED SPELL FOR [Exarch Maladaar] --


function spell0_18373(pUnit, Event) --@Ribbon of Souls,n/a--
pUnit:FullCastSpellOnTarget(32422,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18373', 1500, 1)
end

function spell1_18373(pUnit, Event) --@Soul Scream,Self--
pUnit:FullCastSpellOnTarget(32421,pUnit)
pUnit:RegisterEvent('Sorts_18373', 2391, 1)
end

function spell2_18373(pUnit, Event) --@Stolen Soul,n/a--
pUnit:FullCastSpellOnTarget(32346,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18373', 1000, 1)
end

function spell3_18373(pUnit, Event) --@Summon Avatar,n/a--
pUnit:FullCastSpellOnTarget(32424,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18373', 2000, 1)
end

function Sorts_18373(pUnit, Event)
local choix_sorts_18373 = math.random(0, 3)
if choix_sorts_18373 == 0 then
pUnit:RegisterEvent('spell0_18373', 1, 1)
end
if choix_sorts_18373 == 1 then
pUnit:RegisterEvent('spell1_18373', 1, 1)
end
if choix_sorts_18373 == 2 then
pUnit:RegisterEvent('spell2_18373', 1, 1)
end
if choix_sorts_18373 == 3 then
pUnit:RegisterEvent('spell3_18373', 1, 1)
end
end

function mob18373_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18373', math.random(1500, 3000), 1)
end

function mob18373_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18373_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18373_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18373, 1, 'mob18373_Action')
RegisterUnitEvent(18373, 2, 'mob18373_Leave')
RegisterUnitEvent(18373, 3, 'mob18373_Kill')
RegisterUnitEvent(18373, 4, 'mob18373_Die')
